package com.ice.work.moment.facade.ticket.controller;


import com.honeybee.cloud.framework.common.annotation.ApiVersion;
import com.honeybee.cloud.framework.common.response.ResponseEntity;
import com.ice.work.moment.facade.ticket.controller.fallback.UserHystrixFallbackFactory;
import com.ice.work.moment.facade.ticket.dto.CarDTO;
import com.ice.work.moment.facade.ticket.request.QueryTicketRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Description 12306 ticket
 * @Author DELL
 * @Create 2019-04-29
 * @Since 1.0.0
 */
@SuppressWarnings("all")
@FeignClient(value = "moment-ticket-v1", fallbackFactory = UserHystrixFallbackFactory.class)
@RequestMapping("ticket-ticket/{version}")
@ApiVersion
public interface ITicketController {

    /**
     * 查询车次车票信息
     *
     * @param request
     * @return
     */
    @RequestMapping(name = "查询车次车票信息", value = "query-ticket", method = RequestMethod.POST)
    @ApiVersion(1)
    ResponseEntity<List<CarDTO>> queryTicket(@RequestBody @Validated QueryTicketRequest request, @RequestParam(value = "appKey",defaultValue = "") String appKey);
}
